CREATE TABLE [dbo].[StudGrup]
(
[Ik_grup] [int] NOT NULL,
[Ik_zach] [int] NOT NULL,
[ik_kat_zach] [int] NULL,
[Ik_prikazZach] [int] NULL,
[ik_pricZach] [int] NOT NULL,
[cObosnZach] [varchar] (500) COLLATE Cyrillic_General_CI_AS NULL,
[Ik_prikazOtch] [int] NULL,
[ik_pricOtch] [int] NULL,
[cObosnOtch] [varchar] (500) COLLATE Cyrillic_General_CI_AS NULL,
[Ik_studGrup] [int] NOT NULL IDENTITY(1, 1)
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StudGrup] ADD CONSTRAINT [PK_StudGrup] PRIMARY KEY CLUSTERED  ([Ik_studGrup]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StudGrup] ADD CONSTRAINT [IX_StudGrup] UNIQUE NONCLUSTERED  ([Ik_grup], [Ik_zach], [Ik_prikazZach], [Ik_prikazOtch]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StudGrup] WITH NOCHECK ADD CONSTRAINT [FK_StudZach_Grup] FOREIGN KEY ([Ik_grup]) REFERENCES [dbo].[Grup] ([Ik_grup])
GO
ALTER TABLE [dbo].[StudGrup] WITH NOCHECK ADD CONSTRAINT [FK_StudGrup_Kat_zach] FOREIGN KEY ([ik_kat_zach]) REFERENCES [dbo].[Kat_zach] ([Ik_kat_zach])
GO
ALTER TABLE [dbo].[StudGrup] WITH NOCHECK ADD CONSTRAINT [FK_StudZach_Zach] FOREIGN KEY ([Ik_zach]) REFERENCES [dbo].[Zach] ([Ik_zach])
GO
